package com.zjj.learn.designmodel.work.builder;

/**
 * 指挥者
 **/
public class Director {

    /**
     * 建造者，建造自行车必须使用建造者才能完成
     **/
    private Builder builder;

    public Director(Builder builder) {
        this.builder = builder;
    }

    /**
     * 生产方法
     **/
    public Bike construct(){
        builder.buildSaddle();
        builder.buildCarriageWheel();
        Bike bike = builder.createBike();
        System.out.println(bike.getName() + " 自行车生产成功");
        return bike;
    }
}
